import java.util.*;

public class Board {
    public boolean checkWon(int[][] board) {
        int tmp = 0;

        for (int i = 0; i < board.length; i++) {
            for (int j=0;j < board.length;j++){
                tmp+=board[i][j];
            }
        }

        if (tmp==board.length){
            return true;
        } else {
            tmp=0;
        }

        for (int j = 0; j < board.length; j++) {
            for (int i=0;i < board.length;i++){
                tmp+=board[i][j];
            }
        }

        if (tmp==board.length){
            return true;
        } else {
            tmp=0;
        }

        for (int i = 0; i < board.length; i++) {
            tmp += board[i][i];
        }

        if (tmp==board.length){
            return true;
        } else {
            tmp=0;
        }

        return false;
    }
}
